package com.yuandian.business.monitor.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.business_monitor.po.AlarmParams;
import com.yuandian.api.business_monitor.po.ItSegmentDataParams;
import com.yuandian.api.business_monitor.po.SegmentOverviewParams;
import com.yuandian.api.business_monitor.vo.NetworkElement;
import com.yuandian.api.business_monitor.vo.NetworkElementTop;
import com.yuandian.api.business_monitor.vo.SegmentDetailVo;
import com.yuandian.api.business_monitor.vo.SegmentOverviewVo;
import com.yuandian.business.monitor.mapper.SegmentMapper;
import com.yuandian.business.monitor.service.ISegmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 说明：IT端信息service实现
 *
 * @Author yanjun
 * @Date 2020/9/21 15:32
 */
@Service
public class SegmentServiceImpl implements ISegmentService {

	@Autowired
	private SegmentMapper segmentMapper;


	/**
	 * 查询端运行详情数据
	 *
	 * @param params It路径图端查询参数对象
	 * @return 端运行详情对象集合
	 */
	@Override
	public List<SegmentDetailVo> querySegmentDetail(ItSegmentDataParams params) {
		return segmentMapper.querySegmentDetail(params);
	}

	@Override
	public Page<NetworkElement> queryNetworkElementBysegmentId(SegmentOverviewParams params) {
		Page<NetworkElement> page = new Page<>(params.getPageNum(), params.getPageSize());
		return segmentMapper.queryNetworkElementBysegmentId(page, params);
	}

	@Override
	public NetworkElementTop queryNetworkElementTop(SegmentOverviewParams params) {
		return segmentMapper.queryNetworkElementTop(params);
	}


	/**
	 * 查询网端告警类型占比数据
	 *
	 * @param params 参数
	 * @return 通用返回对象
	 */
	@Override
	public List<SegmentOverviewVo> querySegmentAlarmProportion(AlarmParams params) {

		return segmentMapper.querySegmentAlarmProportion(params);
	}


}
